package com.example.teamtribe.main.club.clubintroduce;

import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.TextView;

import com.example.teamtribe.R;
import com.example.teamtribe.base.BaseFragment;
import com.example.teamtribe.event.EventTeam;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Created by lenovo on 2018/5/4.
 */

public class IntroduceFragment extends BaseFragment {
        private TextView introduce;

        @Override
        protected int setContentView() {
            return R.layout.fragment_club_introduce;
        }

        @Override
        protected void onCreateView(View view) {
            introduce=(TextView)view.findViewById(R.id.tv_introduce);
            introduce.setMovementMethod(ScrollingMovementMethod.getInstance());
            EventBus.getDefault().register(this);
        }

        @Override
        public void onDestroyView() {
                super.onDestroyView();
                EventBus.getDefault().unregister(this);
        }

        @Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
        public void setIntroduce(EventTeam eventTeam) {
                String commet=eventTeam.getTeam().getComment();
                introduce.setText(commet);
        }
}
